package com.example.controller;

import com.example.pojo.Entriprise;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

@RestController
@RequestMapping("/books")
public class BookController {



    @Value("${enterprise.name}")
    private String name;
    @Value("${enterprise.age}")
    private Integer age;
    @Value("${enterprise.tel}")
    private String tel;

    @Autowired
    private Entriprise evn;

    @GetMapping("/{id}")
    public String getById(@PathVariable Integer id) {
        System.out.println(evn);
        System.out.println("=============");
        System.out.println(name);
        System.out.println(age);
        System.out.println(tel);
        System.out.println(evn.getSubject());
        System.out.println("===============");
        System.out.println("id ==> " + id);
        return "hello , spring boot! ";
    }
}
